/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "posVolume")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "POSVolume.findOpenTabs", query = "SELECT v FROM POSVolume v WHERE v.id = :id"),
    @NamedQuery(name = "POSVolume.findAll", query = "SELECT v FROM POSVolume v ORDER BY v.id ASC")})
public class POSVolume implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    //@GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "posVolID")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posCurVol")
    private float currentVolume;
    //Value from 0 - 9 indicates index of which value to replace.
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossID")
    private int lossIndex;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossVol0")
    private float volumeLoss0;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossVol1")
    private float volumeLoss1;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossVol2")
    private float volumeLoss2;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossVol3")
    private float volumeLoss3;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossVol4")
    private float volumeLoss4;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossVol5")
    private float volumeLoss5;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossVol6")
    private float volumeLoss6;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossVol7")
    private float volumeLoss7;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossVol8")
    private float volumeLoss8;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossVol9")
    private float volumeLoss9;
    @Basic(optional = false)
    @NotNull
    @Column(name = "posLossAvg")
    private float averageLoss;

    public POSVolume() {
    }

    public POSVolume(Integer id) {
        this.id = id;
    }

    public POSVolume(Integer id, float currentVolume, int lossIndex, float volumeLoss0, float volumeLoss1, float volumeLoss2, float volumeLoss3, float volumeLoss4, float volumeLoss5, float volumeLoss6, float volumeLoss7, float volumeLoss8, float volumeLoss9, float averageLoss) {
        this.id = id;
        this.currentVolume = currentVolume;
        this.lossIndex = lossIndex;
        this.volumeLoss0 = volumeLoss0;
        this.volumeLoss1 = volumeLoss1;
        this.volumeLoss2 = volumeLoss2;
        this.volumeLoss3 = volumeLoss3;
        this.volumeLoss4 = volumeLoss4;
        this.volumeLoss5 = volumeLoss5;
        this.volumeLoss6 = volumeLoss6;
        this.volumeLoss7 = volumeLoss7;
        this.volumeLoss8 = volumeLoss8;
        this.volumeLoss9 = volumeLoss9;
        this.averageLoss = averageLoss;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public float getCurrentVolume() {
        return currentVolume;
    }

    public void setCurrentVolume(float currentVolume) {
        this.currentVolume = currentVolume;
    }

    public int getLossIndex() {
        return lossIndex;
    }

    public void setLossIndex(int lossIndex) {
        this.lossIndex = lossIndex;
    }

    public float getVolumeLoss0() {
        return volumeLoss0;
    }

    public void setVolumeLoss0(float volumeLoss0) {
        this.volumeLoss0 = volumeLoss0;
    }

    public float getVolumeLoss1() {
        return volumeLoss1;
    }

    public void setVolumeLoss1(float volumeLoss1) {
        this.volumeLoss1 = volumeLoss1;
    }

    public float getVolumeLoss2() {
        return volumeLoss2;
    }

    public void setVolumeLoss2(float volumeLoss2) {
        this.volumeLoss2 = volumeLoss2;
    }

    public float getVolumeLoss3() {
        return volumeLoss3;
    }

    public void setVolumeLoss3(float volumeLoss3) {
        this.volumeLoss3 = volumeLoss3;
    }

    public float getVolumeLoss4() {
        return volumeLoss4;
    }

    public void setVolumeLoss4(float volumeLoss4) {
        this.volumeLoss4 = volumeLoss4;
    }

    public float getVolumeLoss5() {
        return volumeLoss5;
    }

    public void setVolumeLoss5(float volumeLoss5) {
        this.volumeLoss5 = volumeLoss5;
    }

    public float getVolumeLoss6() {
        return volumeLoss6;
    }

    public void setVolumeLoss6(float volumeLoss6) {
        this.volumeLoss6 = volumeLoss6;
    }

    public float getVolumeLoss7() {
        return volumeLoss7;
    }

    public void setVolumeLoss7(float volumeLoss7) {
        this.volumeLoss7 = volumeLoss7;
    }

    public float getVolumeLoss8() {
        return volumeLoss8;
    }

    public void setVolumeLoss8(float volumeLoss8) {
        this.volumeLoss8 = volumeLoss8;
    }

    public float getVolumeLoss9() {
        return volumeLoss9;
    }

    public void setVolumeLoss9(float volumeLoss9) {
        this.volumeLoss9 = volumeLoss9;
    }

    public float getAverageLoss() {
        return averageLoss;
    }

    public void setAverageLoss(float averageLoss) {
        this.averageLoss = averageLoss;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof POSVolume)) {
            return false;
        }
        POSVolume other = (POSVolume) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.posvolume[ id=" + id + " ]";
    }
}
